package by.bsu.rfe.belianko.euniversity.pool;

import java.util.ResourceBundle;

/**
 * Loads DB configurations from config.properties.
 * 
 * @author Vitali_Belianko
 * 
 */
public final class ConfigurationManager {
	private static final String BUNDLE_NAME = "config";
	public static final String DATABASE_DRIVER_NAME = "DATABASE_DRIVER_NAME";
	public static final String DATABASE_URL = "DATABASE_URL";
	public static final String DATABASE_LOGIN = "DATABASE_LOGIN";
	public static final String DATABASE_PASSWORD = "DATABASE_PASSWORD";
	public static final String POOL_SIZE = "POOL_SIZE";
	private static final ResourceBundle resourceBundle = ResourceBundle.getBundle(BUNDLE_NAME);
	private static ConfigurationManager instance;

	private ConfigurationManager() {
		
	}


	public static ConfigurationManager getInstance() {
		if (instance == null) {
			instance = new ConfigurationManager();
			

		}
		return instance;
	}

	public String getProperty(String key) {
		return (String) resourceBundle.getObject(key);
	}
}